@(id: Long, house: House)(implicit lang: Lang)

<table class="seating-plan">
	<tr class="screen">
		<td colspan="@if(house.col3>0){@(house.col1+house.col2+house.col3+2)}else {@if(house.col2 > 0 ){@(house.col1+house.col2+1)}else{@house.col1}}">@Messages("movie.screen")(lang)</td>
	</tr>
	<tr class="space">
		<td></td>
	</tr>
	@for(i <- 1 to house.row1) {
		<tr>
				@for(j <- 1 to house.col1) {
					<td class="seat" data-session="@id" data-seat="@((64+i).toChar)@j">@j</td>
				}
				@if(house.col2 > 0) {
					<td class="path">@((64+i).toChar)</td>
					@for(j <- 1 to house.col2) {
						<td class="seat" data-session="@id" data-seat="@((64+i).toChar)@(house.col1+j)">@(house.col1+j)</td>
					}

					@if(house.col3 > 0) {
						<td class="path">@((64+i).toChar)</td>
						@for(j <- 1 to house.col3) {
							<td class="seat" data-session="@id" data-seat="@((64+i).toChar)@(house.col1+house.col2+j)">@(house.col1+house.col2+j)</td>
						}
					}
				}
		</tr>
	}
	@if(house.row2 > 0) {
		<tr class="space">
			<td></td>
		</tr>
		@for(i <- 1 to house.row2) {
			<tr>
					@for(j <- 1 to house.col1) {
						<td class="seat" data-session="@id" data-seat="@((64+i+house.row1).toChar)@j">@j</td>
					}
					@if(house.col2 > 0) {
						<td class="path">@((64+i+house.row1).toChar)</td>
						@for(j <- 1 to house.col2) {
							<td class="seat" data-session="@id" data-seat="@((64+i+house.row1).toChar)@(house.col1+j)">@(house.col1+j)</td>
						}

						@if(house.col3 > 0) {
							<td class="path">@((64+i+house.row1).toChar)</td>
							@for(j <- 1 to house.col3) {
								<td class="seat" data-session="@id" data-seat="@((64+i+house.row1).toChar)@(house.col1+house.col2+j)">@(house.col1+house.col2+j)</td>
							}
						}
					}
			</tr>

		}

		@if(house.row3 > 0) {
			<tr class="space">
				<td></td>
			</tr>
			@for(i <- 1 to house.row3) {
				<tr>
						@for(j <- 1 to house.col1) {
							<td class="seat" data-session="@id" data-seat="@((64+i+house.row1+house.row2).toChar)@j">@j</td>
						}
						@if(house.col2 > 0) {
							<td class="path">@((64+i+house.row1+house.row2).toChar)</td>
							@for(j <- 1 to house.col2) {
								<td class="seat" data-session="@id" data-seat="@((64+i+house.row1+house.row2).toChar)@(house.col1+j)">@(house.col1+j)</td>
							}

							@if(house.col3 > 0) {
								<td class="path">@((65+i+house.row1+house.row2).toChar)</td>
								@for(j <- 1 to house.col3) {
									<td class="seat" data-session="@id" data-seat="@((64+i+house.row1+house.row2).toChar)@(house.col1+house.col2+j)">@(house.col1+house.col2+j)</td>
								}
							}
						}
				</tr>

			}

		}

	}



</table>
